from PyQt5.QtWidgets import QWidget
import pyqtgraph as pg


class VoltageGraph(QWidget):
    def __init__(self):
        super().__init__()
        self.resize(800, 260)
        self.pw = pg.PlotWidget(self)
        self.pw.resize(780, 240)
        self.plot_num = 200
        self.curve = self.pw.plot(pen='y')
        self.pw.setXRange(0, self.plot_num)
        self.pw.setYRange(0, 17000000)
        pg.setConfigOptions(leftButtonPan=False, antialias=False)

    def handle_data(self, data):
        self.curve.setData(data)
